/**
 * \file TranslationUnit.h
 *
 * Asteriskos Compiler 1
 * Written 2010-2011, by Anthony Berlin and Alexander Carlqvist
 *
 * This file is part of ICC.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef TRANSLATION_UNIT_H
#define TRANSLATION_UNIT_H

#include "SourceLine.h"
#include "Error.h"

#include <GCB/Object.h>

class TranslationUnit : public Object
{
public:
    TranslationUnit(const char* url, string& appFileName);
    TranslationUnit();
    string get_path() const;
    void set_path(string path);
    list<SourceLine*>* get_lines() const;
    void push_line_last(string filename, unsigned int lineNumber, string data);
    bool dump_to_disc(const char* path, string& appFileName) const;

    /// Load the translation-unit into memory.
    bool load(const char* url);
private:
    string m_path;
    list<SourceLine*>* m_lines;
};

#endif // TRANSLATION_UNIT_H
